package com.xxcloud.search.model.note;

import java.io.Serializable;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * Created by chenbingwen on 19/10/29.<br/>
 *
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Document(indexName = NoteIndex.INDEX_NAME, type = NoteIndex.INDEX_TYPE, shards = NoteIndex.INDEX_SHARDS)
public class NoteModel implements Serializable {

    private static final long serialVersionUID = -392106867502255270L;

    @Id
    private Long id;

    @Field(type = FieldType.Long)
    private Long folderId;

    @Field(type = FieldType.Text)
    private String title;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Date)
    private Date createTime;

    @Field(type = FieldType.Date)
    private Date updateTime;

}
